//
//  MainTabBarViewController.m
//  hello mui
//
//  Created by zhangtao on 15/9/17.
//  Copyright (c) 2015年 zt.td. All rights reserved.
//

#import "MainTabBarViewController.h"
#import "PersonCenterViewController.h"
#import "LoveStuViewController.h"

#import "WXApiRequestHandler.h"


@interface MainTabBarViewController ()

@end

@implementation MainTabBarViewController




- (void)viewDidLoad {
    [super viewDidLoad];
    
    UINavigationController *homeNav = [self.storyboard instantiateViewControllerWithIdentifier:@"homeNav"];
    homeNav.tabBarItem.image = [UIImage imageNamed:@"home"];
    homeNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"home－hover"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

  
    

    
    UINavigationController *answerNav = [self.storyboard instantiateViewControllerWithIdentifier:@"answerNav"];
    answerNav.tabBarItem.image = [[UIImage imageNamed:@"answer"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    answerNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"answer－hover"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    

  
    
    UINavigationController *perNav = [self.storyboard instantiateViewControllerWithIdentifier:@"perNav"];
    
    perNav.tabBarItem.image = [[UIImage imageNamed:@"my"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    perNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"my－hover"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    //     [homeNav.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:RGB(66, 189, 111, 1),UITextAttributeTextColor, nil] forState:UIControlStateSelected];
    //    [answerNav.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:RGB(66, 189, 111, 1),UITextAttributeTextColor, nil] forState:UIControlStateSelected];
//     [perNav.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:RGB(66, 189, 111, 1),UITextAttributeTextColor, nil] forState:UIControlStateSelected];
    
    NSMutableDictionary *dicText = [NSMutableDictionary dictionary];
    dicText [NSForegroundColorAttributeName] = RGB(66, 189, 111, 1);
    
    
    [homeNav.tabBarItem setTitleTextAttributes:dicText forState:UIControlStateSelected];
    
    [answerNav.tabBarItem setTitleTextAttributes:dicText forState:UIControlStateSelected];

    
    [perNav.tabBarItem setTitleTextAttributes:dicText forState:UIControlStateSelected];

    [self setViewControllers:@[homeNav,answerNav,perNav]];
    
//
    
    
    
//    PersonCenterViewController *person = [self.storyboard instantiateViewControllerWithIdentifier:@"personCenter"];
//    person.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"person" image:[UIImage imageNamed:@"my－hover"] selectedImage:[UIImage imageNamed:@"my－hoverHight"]];
//
  
//    UINavigationController *nav1 = [[UINavigationController alloc]initWithRootViewController:person];
   
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)sendAuthRequest{
    [WXApiRequestHandler sendAuthRequestScope: Scope
                                        State:@"state"
                                       OpenID:AppID
                             InViewController:self];
}






@end
